@extends("admin.index")

@section("title","系统配置")

@section("content")
    <div class="page-inner">
        <div class="page-header">
            <nav class="breadcrumb">
                <div class="left row">
                    <li class="breadcrumb-item"><a href="#">产品管理</a></li>
                    <li class="breadcrumb-item active" aria-current="page">产品分类创建</li>
                </div>
                <div class="right row">
                    <li class="breadcrumb-item"><i class="fa fa-reply"></i></li>
                    <li class="breadcrumb-item active" aria-current="page"><i class="fa fa-refresh"></i> </li>
                </div>
            </nav>
        </div>

        <div class="row">
            <div class="col-md-12 grid-margin stretch-card">
                <div class="card">
                    <form class="forms-sample" action="{{route('admin.config.store')}}" method="post">
                        <div class="card-body">
                        @if ($errors->any())
                            @foreach ($errors->all() as $error)
                            <div class="alert alert-danger">
                                {{ $error }}
                            </div>
                            @endforeach
                        @endif
                        @if(session()->has("data"))
                            <div class="alert alert-{{session('data')['class']}}">
                                {{ session('data')['msg'] }}
                            </div>
                        @endif

                            <div class="form-group">
                                @csrf
                                <input type="hidden" name="name" value="baidu">
                                <input type="hidden" name="title" value="百度推送">
                                <label for="key">百度秘钥</label>
                                <input type="text" name="key" class="form-control" id="key" value="{{isset($config['key']) ? $config['key'] : ''}}" placeholder="请输入百度秘钥">
                            </div>
                        </div>

                        <div class="card-action">
                            <button class="btn btn-success" type="submit">Submit</button>
                            <button class="btn btn-danger">Cancel</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
